import time
from datetime import datetime


def timeit(fn):
    def wrapper(*args, **kwargs):
        start_time = datetime.now()
        res = fn(*args, **kwargs)
        print("spend time is {} seconds".format((datetime.now()-start_time).total_seconds()))
        return res
    return wrapper


@timeit
def add(x, y):
    time.sleep(3)
    return x + y

add(1,2)